<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>行政考核  <{$smarty.const.WEB_NAME}></title>
	<link rel="stylesheet" type="text/css" href="./skin/default/style.css" />
	<script type="text/javascript" src="./skin/default/comm.js"></script>
	<script type="text/javascript" src="./skin/default/calendar.js"></script>
</HEAD>

<BODY>
	<table>
		<tr>
			<th align="center" id="thId">行政考核统计</th>
		</tr>
	</table>
	<table width="100%" border="1" cellspacing="0" bordercolor="#cfcfcd" cellpadding="0" class="tableList tip_bug">
		<tr>
			<td align="center">员工</td>
			<td align="center">迟到(次)</td>
			<td align="center">早退(次)</td>
			<td align="center">请假(天)</td>
			<td align="center">无故请假(天)</td>
			<td align="center">补休(天)</td>
			<td align="center">旷工(天)</td>
			<td align="center">加班(天)</td>
			<td align="center">工作报告(次)</td>
			<td align="center">提醒(次)</td>
			<td align="center">警告(次)</td>
			<td align="center">劳动(次)</td>
			<td align="center">未打卡(次)</td>
			<td align="center">违反出入登记(次)</td>
			<td align="center">出差(天)</td>
			<td align="center">节省资源(次)</td>
			<td align="center">特殊贡献(次)</td>
			<td align="center">总得分</td>
			<td align="center">等级</td>
		</tr>
		<{section name=i loop=$list}>
		<tr>
			<td align="center"><{$list[i].name}></td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'overDue', <{$list[i].overDue}>)">
				<{if $list[i].overDue > 0}>
				<{$list[i].overDue}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'earlyLeave', <{$list[i].earlyLeave}>)">
				<{if $list[i].earlyLeave > 0}>
				<{$list[i].earlyLeave}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'normalLeave', <{$list[i].normalLeave}>)">
				<{if $list[i].normalLeave > 0}>
				<{$list[i].normalLeave}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'abnormalLeave', <{$list[i].abnormalLeave}>)">
				<{if $list[i].abnormalLeave > 0}>
				<{$list[i].abnormalLeave}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'vacation', <{$list[i].vacation}>)">
				<{if $list[i].vacation > 0}>
				<{$list[i].vacation}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'absentWork', <{$list[i].absentWork}>)">
				<{if $list[i].absentWork > 0}>
				<{$list[i].absentWork}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'overTime', <{$list[i].overTime}>)">
				<{if $list[i].overTime > 0}>
				<{$list[i].overTime}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'missReport', <{$list[i].missReport}>)">
				<{if $list[i].missReport > 0}>
				<{$list[i].missReport}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'reminding', <{$list[i].reminding}>)">
				<{if $list[i].reminding > 0}>
				<{$list[i].reminding}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'warning', <{$list[i].warning}>)">
				<{if $list[i].warning > 0}>
				<{$list[i].warning}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'rejectWork', <{$list[i].rejectWork}>)">
				<{if $list[i].rejectWork > 0}>
				<{$list[i].rejectWork}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'noCard', <{$list[i].noCard}>)">
				<{if $list[i].noCard > 0}>
				<{$list[i].noCard}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'noRegister', <{$list[i].noRegister}>)">
				<{if $list[i].noRegister > 0}>
				<{$list[i].noRegister}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'evection', <{$list[i].evection}>)">
				<{if $list[i].evection > 0}>
				<{$list[i].evection}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'saveRes', <{$list[i].saveRes}>)">
				<{if $list[i].saveRes > 0}>
				<{$list[i].saveRes}>
				<{/if}>
			</td>
			<td align="center" onclick="javascript:ShowUpdate(<{$year}>, <{$month}>, <{$list[i].userId}>, 'contribute', <{$list[i].contribute}>)">
				<{if $list[i].contribute > 0}>
				<{$list[i].contribute}>
				<{/if}>
			</td>
			<td align="center"><{$list[i].scoreSum}></td>
			<td align="center">
				<{if $list[i].level == 4}>
					优秀
				<{elseif $list[i].level == 3}>
					良好
				<{elseif $list[i].level == 2}>
					达标
				<{elseif $list[i].level == 1}>
					不达标
				<{else}>
					差
				<{/if}>
			</td>
		</tr>
		<{/section}>
	</table>

	<table width="100%" border="1" cellspacing="0" bordercolor="#cfcfcd" cellpadding="0" class="tableList tip_bug">
	<form method="post" id="queryId" onsubmit="return OnCheck()" action="?q=officeManage/">
		<tr>
		  <td align="center"> 
			<input type="text" width="4" id="yearId" name="year" value="<{$year}>" />
			<input type="text" width="2" id="monthId" name="month" value="<{$month}>" />
			<input type="submit" value="指定查询" class="sub_btn" onclick="javascript:OnCurrQuery()"/>
		  </td>
		  <td align="center">
			<input type="submit" value="查询上月" class="sub_btn" onclick="javascript:OnPrevQuery()"/>
			<input type="submit" value="查询下月" class="sub_btn" onclick="javascript:OnNextQuery()"/>
		  </td>
		  <td align="center">
			<input type="button" value="导出记录" class="sub_btn" onclick="javascript:OnExport()"/>
		  </td>
		</tr>
	</form>
	</table>
	
	<table id="updateId" border="1" cellspacing="0" bordercolor="#cfcfcd" cellpadding="0" class="msg_box driftWindow" style="font-size:13px; display:none; width:300px; left:320px; top:50px">
		<form method="post" onsubmit="return CheckUpdateVal()" action="?q=officeManage/updateOfficeKpi">	
		 <tr class="tit">
		   <th align="center" colspan="2">修      改</th>
		   <input type="hidden" name="year" id='upYear' value="" />
		   <input type="hidden" name="month" id='upMonth' value="" />
		   <input type="hidden" name="userId" id='upUserId' value="" />
		   <input type="hidden" name="columnName" id="upColumnName" value="" />
		 </tr>
		 <tr>
			<td width="100" align="center">修改值(次或天)</td>
			<td>
				<input type="text" name="updateValue" id="upUpdateValue" value="" /> 
			</td>
		 </tr>
		 <tr>
			<td align="center" colspan="2">
			  <input type="submit" class="submit" value="提交">
			  <input type="button" value="关闭" onclick="HiddenTable(this)" class="submit"/>
			</td>
		 </tr>
		</form>
    </table>

	<script type="text/javascript">
		<!--
		// 检查表单数据
		function OnCheck() {
			var year = $('yearId').value;
			if( year < 2011 || year > 10000 ) {
				window.alert("非法的年份!");
				return false;
			}

			var month = $('monthId').value;
			if( month < 1 || month > 12 ) {
				window.alert("非法的月份!");
				return false;
			}

			return true;
		}
		
		// 指定查询
		function OnCurrQuery() {
			$('queryId').action += "officeKpi";
		}
		
		// 查询上月
		function OnPrevQuery() {
			$('queryId').action += "officeKpi";
			var year = $('yearId').value;
			var month = $('monthId').value;
			if( month == 1 ) {
				$('yearId').value = parseInt(year, 10) - 1;
				$('monthId').value = 12;
			} else {
				$('monthId').value = parseInt(month, 10) - 1;
			}
		}
		
		// 查询下月
		function OnNextQuery() {
			$('queryId').action += "officeKpi";
			var year = $('yearId').value;
			var month = $('monthId').value;
			if( month == 12 ) {
				$('yearId').value = parseInt(year, 10) + 1;
				$('monthId').value = 1;
			} else {
				$('monthId').value = parseInt(month, 10) + 1;
			}
		}
		
		// 隐藏表格
		function HiddenTable(obj) {
			do {
				obj = obj.parentElement;
				if( obj != null && obj.nodeName == "TABLE") {
					break;
				}
			}
			while (obj != null);

			obj.style.display = "none";
		}
		
		// 显示修改
		function ShowUpdate(year, month, userId, columnName, columnVal) {
			$('upYear').value = year;
			$('upMonth').value = month;
			$('upUserId').value = userId;
			$('upColumnName').value = columnName;
			$('upUpdateValue').value = columnVal;
			$('updateId').style.display = "block";
		}
		
		// 检查修改
		function CheckUpdateVal() {
			var year = $('upYear').value;
			var month = $('upMonth').value;
			var userId = $('upUserId').value;
			var colName = $('upColumnName').value;
			var colVal = $('upUpdateValue').value;
			return true;
		}
		//-->
	</script>
</BODY>
</HTML>